{extend name="../../base/view/common/base" /}
<!-- 主体 -->
{block name="body"}

<style>
    .layui-laydate-header{
        display: none;
    }
    .layui-laydate-content> table>thead{
        display: none;
    }
    .laydate-day-prev{
        display: none;
    }
    .laydate-day-next{
        display: none;
    }
</style>
<form class="layui-form p-4">
    <table class="layui-table layui-table-form">
        <tr>
            <td class="layui-td-gray-2">名称<font>*</font>
            </td>
            <td>
                <input type="text" name="name" value="{$detail.name|default=''}" lay-verify="required" autocomplete="off" placeholder="请输入名称"
                       lay-reqText="请输入名称" class="layui-input">
            </td>
            <td class="layui-td-gray">地址<font>*</font>
            </td>
            <td>
                <input type="text" name="address" value="{$detail.address|default=''}"   lay-verify="required" autocomplete="off" placeholder="请输入"
                       lay-reqText="请输入" class="layui-input">
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">职务<font>*</font>
            </td>
            <td>
                <input type="text" name="jobName" value="{$detail.jobName|default=''}" lay-verify="required" autocomplete="off" placeholder="请输入"
                       lay-reqText="请输入" class="layui-input">
            </td>
        </tr>
        <tr>
            <td class="layui-td-gray-2">电话<font>*</font>
            </td>
            <td>
                <input type="text" name="phone" value="{$detail.phone|default=''}"  autocomplete="off" placeholder="请输入"
                       lay-reqText="请输入" class="layui-input">
            </td>
            {if $type==2}
            <td class="layui-td-gray-2">收货地址类型<font>*</font>
            </td>
            <td>
                <input type="text" name="addType" value="{$detail.addType|default=''}" lay-verify="required"  autocomplete="off" placeholder="请输入"
                       lay-reqText="请输入" class="layui-input">
            </td>
            {/if}
        </tr>

    </table>
    <div class="py-3">
        <input type="hidden" name="purveyorId" value="{$punterId}">
        <input type="hidden" name="id" value="{$detail.id|default=''}">
        <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="subContact">保存</button>
    </div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script type="text/javascript">
</script>
<script>
    const moduleInit = ['tool'];
    function gouguInit() {
        var form = layui.form,tool=layui.tool,level=0,laydate = layui.laydate;
        //监听提交
        form.on('submit(subContact)', function (data) {
            let callback = function (e) {
                layer.msg(e.msg);
                if (e.code == 0) {
                    setTimeout(function(){
                        parent.location.reload();
                    },1000);
                }
            }
            tool.post("{:url('')}", data.field, callback);
            return false;
        });
        laydate.render({
            elem: '#gz_day' ,// 指定元素
            type:'date',
            format:'d'
        });
    }
</script>
{/block}
<!-- /脚本 -->